package com.bby.user.service;

import com.bby.common.exception.BBYException;
import com.bby.common.model.UserPublicInfo;
import com.bby.common.utils.R;
import com.bby.user.bean.*;
import com.bby.user.bean.req.*;

import java.util.List;

public interface UserService {

    void checkEmail(String email) throws BBYException;

    /**
     * 用户登录
     * @return 包含：code，userId，data（token）
     * @param params
     */
    LoginResult login(LoginRequest params) throws BBYException;

    void logout();

    /**
     * 注册
     *
     * @param params @return 包含：code，userId
     * @return
     */
    UserInfo register(RegisterRequestParams params) throws BBYException;

    /**
     * 注销账户
     */
    boolean closeAccount(String userId) throws BBYException;

    LoginResult loginByCaptcha(LoginByCaptchaRequest params) throws BBYException;

    UserInfo getUserInfo(String userId) throws BBYException;

    void checkName(String username) throws BBYException;

    void sendMilCaptcha(String userId, String mail) throws BBYException;

    R createMailToken(String userId, String mail, String value) throws BBYException;

    void editMail(String userId, MailEditReq params) throws BBYException;

    void editPasswd(String userId, EditPasswdReq param) throws BBYException;

    void editUsername(String userId, String username) throws BBYException;

    UserPublicInfo getUserPublicInfoById(String userId) throws BBYException;

    List<UserPublicInfo> getUserPublicInfoByIds(List<String> ids);

    void editCustom(String userId, String key, String value) throws BBYException;
}
